package com.woniu.controller;

import com.woniu.entity.ExamItem;
import com.woniu.entity.Staff;
import com.woniu.service.ExamItemService;
import com.woniu.utils.ResponseUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/examItem")
public class ExamItemController {
    @Resource
    private ExamItemService examItemService;

    @GetMapping("/findAll")
    public ResponseUtil selectAll(@RequestParam Integer pageNum, @RequestParam Integer pageSize){
        return examItemService.selectAll(pageNum,pageSize);
    }
    @GetMapping("/list")
    public ResponseUtil selectByCondition(@RequestParam(required = false) String itemName,@RequestParam(required = false) Integer status,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
        return examItemService.selectByCondition(itemName,status,pageNum,pageSize);
    }
    @PostMapping("/del")
    public ResponseUtil updateExam(Integer id){
        return examItemService.updateExam(id);
    }
    @PostMapping("/insert")
    public ResponseUtil insertSelective(@RequestBody ExamItem record){
        return examItemService.insertSelective(record);
    }
    @PostMapping("/update")
    public ResponseUtil updateByPrimaryKeySelective(@RequestBody ExamItem record){
        return examItemService.updateByPrimaryKeySelective(record);
    }
    @GetMapping("/selectAll")
    public ResponseUtil findAll(){
        return examItemService.findAll();
    }
}
